Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for applying logging configurations using the a TOML configuration file #3237

Merged
merged 6 commits into from
Apr 26, 2023

Conversation

JoseHJBlanco
Copy link
Contributor

Description

Configuring logging using the "logging" session of the TOML configuration file throws an exception because the logging library tries to write to a frozen dictionary. This PR solves the issue by unfreezing the dictionary before passing it to logging.dictConfig.

Motivation and Context

Starting from version 2.8.11, the logging section of the configuration file is loaded into frozen a dictionary which is then passed to the logging.dictConfig when using the TOML parser. However, logging.dictConfig expects a mutable dictionary and tries to overwrites some of its keys, resulting in an exception. In practice that means we cannot use the TOML configuration file to configure logging.

This problem has been mentioned in the issue #2879

Have you tested this? If so, how?

Manually tested the changes and added a new test case here to replicate the scenario in which the master branch would throw an error.

@JoseHJBlanco JoseHJBlanco requested review from dlstadther and a team as code owners April 25, 2023 15:40
Copy link
Collaborator

@dlstadther dlstadther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Thanks for the contribution and unittest update!

@dlstadther dlstadther merged commit 164c762 into spotify:master Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants